﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PurchasedReceived.aspx.cs"
    Inherits="Main_Inventory_PurchasedReceived" EnableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Purchased Received</title>
    <link href="../../../Styles/accounts.css" rel="Stylesheet" type="text/css" />
    <script type="text/javascript">
        function open_Purchase_Recive_Details(poid, transferedid, trnid) {
            //window.open("Purchase_Recive_Details.aspx?poid=" + poid + "&transferedid=" + transferedid + "&supplier=" + supplier + "&taxgroup=" + taxgroup + ",&trnid=" + trnid + "", 'PurchaseInvoice', 'width=800,height=600,toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
            //window.open("P_inv_Details.aspx?poid=" + poid + "&transferedid=" + transferedid + "&supplier=" + supplier + "&taxgroup=" + taxgroup + ",&trnid=" + trnid + "", "");
            window.open("PurchasedReceivedDisplay.aspx?poid=" + poid + "&transferedid=" + transferedid + "&trnid=" + trnid + "", "");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true">
    </asp:ScriptManager>
    <div class="divmain">
        <acc:heading ID="pagehead" runat="server" HeadingText="Domestic Purchase Order Receive" />
        <asp:UpdateProgress DynamicLayout="false" ID="UpdProgress" runat="server">
            <ProgressTemplate>
                <div align="center">
                    <img src="../../../Images/ajax-loader.gif" alt="" /></div>
            </ProgressTemplate>
        </asp:UpdateProgress>
        <div>
            <div style="height: 5px; width: 50%; margin-left: 10%; margin-right: 25%">
            <asp:Label ID="lblMsg" runat="server" Font-Bold="true"></asp:Label></div>
            <asp:UpdatePanel ID="updateselect" runat="server">
                <ContentTemplate>
                    <asp:Panel ID="PnlAddNew" runat="server" Visible="false">
                        <table cellpadding="5" class="tablecontentnoborder" width="60%" style="margin-left: 20%;
                            margin-right: 18%; padding: 0px; border: 1px solid #818181;">
                            <tr>
                                <td class="headtd" colspan="2">
                                    Purchase Orders
                                </td>
                            </tr>
                            <tr>
                                <td align="center" colspan="2">
                                    <asp:RadioButtonList ID="rblCountry" runat="server" AutoPostBack="true" RepeatDirection="Horizontal"
                                        OnSelectedIndexChanged="rblCountry_SelectedIndexChanged">
                                        <asp:ListItem Text="Domestic" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="International" Value="2"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tr runat="server" id="potd" style="display: none;">
                                <td align="right" width="20%">
                                    <asp:Label ID="lblpo" runat="server" Text="Purchase Order No"></asp:Label>
                                </td>
                                <td width="30%">
                                    <asp:DropDownList ID="DdlApproved" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlApproved_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </ContentTemplate>
            </asp:UpdatePanel>
            <asp:Panel ID="PnlView" runat="server" Visible="false">
                <center>
                    <asp:GridView ID="GrdpurView" runat="server" CssClass="gridview" DataKeyNames="poid,tranreferenceid,trnid"
                        AutoGenerateColumns="false" OnRowDataBound="GrdpurView_RowDataBound" Width="95%"
                        PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="gridview_alternate" AllowPaging="true"
                        PageSize="20" RowStyle-CssClass="gridviewitem" OnRowCreated="GrdpurView_RowCreated"
                        OnPageIndexChanging="GrdpurView_PageIndexChanging">
                        <Columns>
                            <asp:TemplateField HeaderText="S.No.">
                                <ItemTemplate>
                                    <%#Container.DataItemIndex+1 %>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Voucher No." ItemStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:Label ID="lblinvno" runat="server" Text='<%#Eval("voucherno") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="PO No." ItemStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <a href="#" onclick="window.open('../InventoryPrint/Default.aspx?Poid=<%#DataBinder.Eval(Container.DataItem,"POID")%>','','width=800,height=600,toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes')">
                                        <%#Eval("pono")%></a>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Supplier" ItemStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:Label ID="lblsupplier" runat="server" Text='<%#Eval("LNAME") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Invoice Number">
                                <ItemTemplate>
                                    <asp:Label ID="lblvoucherno" runat="server" Text='<%#Eval("invoiceno") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Invoice Date">
                                <ItemTemplate>
                                    <asp:Label ID="lblvoudate" runat="server" Text='<%#Eval("TRNDATE", "{0:dd-MMM-yyyy}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Purchase Receive Date">
                                <ItemTemplate>
                                    <asp:Label ID="lblvoudatedfs" runat="server" Text='<%#Eval("PurchaseRecDate", "{0:dd-MMM-yyyy}") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Invoice Amount">
                                <ItemTemplate>
                                    <asp:Label ID="lblvoutotal" runat="server" Text='<%#Eval("TotalInvoiceAmt","{0:0.00}")%>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Details">
                                <ItemTemplate>
                                    <asp:LinkButton ID="hyppurdtails" runat="server" Text="Details"></asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                        </Columns>
                        <PagerStyle HorizontalAlign="Right" />
                        <AlternatingRowStyle CssClass="gridview_alternate"></AlternatingRowStyle>
                    </asp:GridView>
                </center>
            </asp:Panel>
        </div>
    </div>
    </form>
</body>
</html>
